﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace NpCrm.Domain
{
    public class Organization : NpCrmEntityBase
    {
        [Key]
        [DatabaseGenerated(DatabaseGenerationOption.Identity)]
        public int OrganizationId { get; set; }

        [Required(ErrorMessage = "Please enter a name")]
        [StringLength(100, ErrorMessage = "Name is too long")]
        public string Name { get; set; }

        [StringLength(50, ErrorMessage = "Tax identifier number too long")]
        public string TaxIdNumber { get; set; }

        public virtual ICollection<Contact> Contacts { get; set; }

        public virtual ICollection<Address> Addresses { get; set; }

        public virtual ICollection<Donation> Donations { get; set; }

        public Organization()
        {
            Contacts = new HashSet<Contact>();
        }
    }
}
